package com.ktgj.other.service.impl;

import java.text.SimpleDateFormat;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.other.mapper.EtOrderCyclerecordMapper;
import com.ktgj.other.domain.EtOrderCyclerecord;
import com.ktgj.other.service.IEtOrderCyclerecordService;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-22
 */
@Service
public class EtOrderCyclerecordServiceImpl implements IEtOrderCyclerecordService 
{
    @Autowired
    private EtOrderCyclerecordMapper etOrderCyclerecordMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param cyclerecordid 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public EtOrderCyclerecord selectEtOrderCyclerecordById(Long cyclerecordid)
    {
        return etOrderCyclerecordMapper.selectEtOrderCyclerecordById(cyclerecordid);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param etOrderCyclerecord 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<EtOrderCyclerecord> selectEtOrderCyclerecordList(EtOrderCyclerecord etOrderCyclerecord)
    {
        return etOrderCyclerecordMapper.selectEtOrderCyclerecordList(etOrderCyclerecord);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param etOrderCyclerecord 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertEtOrderCyclerecord(EtOrderCyclerecord etOrderCyclerecord)
    {
        return etOrderCyclerecordMapper.insertEtOrderCyclerecord(etOrderCyclerecord);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param etOrderCyclerecord 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateEtOrderCyclerecord(EtOrderCyclerecord etOrderCyclerecord)
    {
        return etOrderCyclerecordMapper.updateEtOrderCyclerecord(etOrderCyclerecord);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param cyclerecordids 需要删除的【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteEtOrderCyclerecordByIds(Long[] cyclerecordids)
    {
        return etOrderCyclerecordMapper.deleteEtOrderCyclerecordByIds(cyclerecordids);
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param cyclerecordid 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteEtOrderCyclerecordById(Long cyclerecordid)
    {
        return etOrderCyclerecordMapper.deleteEtOrderCyclerecordById(cyclerecordid);
    }

    /**
     * 订单追踪
     * */
    @Override
    public List<EtOrderCyclerecord> orderTracking(Long id) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        List<EtOrderCyclerecord> etOrderCyclerecordList = etOrderCyclerecordMapper.orderTracking(id);
        if (etOrderCyclerecordList != null &&etOrderCyclerecordList.size() > 0){
            for (EtOrderCyclerecord etOrderCyclerecord : etOrderCyclerecordList) {
                etOrderCyclerecord.setTime(format.format(etOrderCyclerecord.getCreateTime()));
            }
        }
        return etOrderCyclerecordList;
    }
}
